package com.qf.controller;

import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 千峰教育
 * @Company http://www.mobiletrain.org/
 * @Version 1.0
 */
@RestController
public class TestController {

//    @RequiresRoles("管理员") //判断该用户是否拥有该角色
    @RequiresPermissions(value = {"sys:user:add", "sys:user:update"}, logical = Logical.OR)
    @RequestMapping("/test")
    public String test(){
        System.out.println("测试方法1");
        return "success";
    }

//    @RequiresRoles("开发工程师")
    @RequiresPermissions(value = {"sys:kaoqing:add"}) //判断该用户是否拥有某权限
    @RequestMapping("/test1")
    public String test1(){
        System.out.println("测试方法2");
        return "success";
    }
}
